<!--
 * @Date: 2025-03-14 10:06:05
 * @Author: LiSong
 * @LastEditors: LiSong
 * @LastEditTime: 2025-03-14 10:06:07
 * @Description: 
-->
<!--
 * @Date: 2025-03-12 14:12:56
 * @Author: LiSong
 * @LastEditors: LiSong
 * @LastEditTime: 2025-03-14 09:59:22
 * @Description: 任务中心
-->
<template>
  <div class="hp-task-panel">
    <div class="hp-task-panel-header" v-if="schema.showHeader">
      <div class="header-title">{{ schema.label }}</div>
      <div class="header-tools"></div>
    </div>
    <div class="hp-task-panel-body">
      <el-tabs
        class="hp-task-tabs"
        v-model="tabState.activeName"
      >
        <el-tab-pane name="cbxm" >
          <template #label>
            <div class="hp-task-tab-pane__label">储备项目<span style="color: red">(3)</span></div>
          </template>
          <div class="hp-task-tab-pane__body">
            <div class="task-card">
              <div class="task-card-header">
                <div class="task-title">储备项目填报</div>
              </div>
              <div class="task-card-body">
                <div class="task-card-item">
                  <div class="task-card-item-head">
                    <span>未送审</span>
                  </div>
                  <div class="task-card-item-body">
                    <div class="item-icon">
                      <RkIcon name="rk-icon-no-audit" :size="22"/>
                    </div>
                    <div class="item-number">9999</div>
                  </div>
                </div>
                <div class="task-card-item">
                  <div class="task-card-item-head">
                    <span>被退回</span>
                  </div>
                  <div class="task-card-item-body">
                    <div class="item-icon">
                      <RkIcon name="rk-icon-has-back" :size="22"/>
                    </div>
                    <div class="item-number">9999</div>
                  </div>
                </div>
              </div>
            </div>

            <div class="task-card">
              <div class="task-card-header">
                <div class="task-title">储备项目审核</div>
              </div>
              <div class="task-card-body">
                <div class="task-card-item">
                  <div class="task-card-item-head">
                    <span>未审核</span>
                  </div>
                  <div class="task-card-item-body">
                    <div class="item-icon">
                      <RkIcon name="rk-icon-no-audit" :size="22"/>
                    </div>
                    <div class="item-number">9999</div>
                  </div>
                </div>
              </div>
            </div>

            <div class="task-card">
              <div class="task-card-header">
                <div class="task-title">下级项目审核</div>
              </div>
              <div class="task-card-body">
                <div class="task-card-item">
                  <div class="task-card-item-head">
                    <span>未审核</span>
                  </div>
                  <div class="task-card-item-body">
                    <div class="item-icon">
                      <RkIcon name="rk-icon-no-audit" :size="22"/>
                    </div>
                    <div class="item-number">9999</div>
                  </div>
                </div>
                <div class="task-card-item">
                  <div class="task-card-item-head">
                    <span>被退回</span>
                  </div>
                  <div class="task-card-item-body">
                    <div class="item-icon">
                      <RkIcon name="rk-icon-has-back" :size="22"/>
                    </div>
                    <div class="item-number">9999</div>
                  </div>
                </div>
              </div>
            </div>
            
          </div>
        </el-tab-pane>
        <el-tab-pane name="wsxm" >
          <template #label>
            <div class="hp-task-tab-pane__label">完善项目</div>
          </template>
          <div class="hp-task-tab-pane__body">
            <div class="task-card">
              <div class="task-card-header">
                <div class="task-title">完善项目填报</div>
              </div>
              <div class="task-card-body">
                <div class="task-card-item">
                  <div class="task-card-item-head">
                    <span>未送审</span>
                  </div>
                  <div class="task-card-item-body">
                    <div class="item-icon">
                      <RkIcon name="rk-icon-no-audit" :size="22"/>
                    </div>
                    <div class="item-number">9999</div>
                  </div>
                </div>
                <div class="task-card-item">
                  <div class="task-card-item-head">
                    <span>被退回</span>
                  </div>
                  <div class="task-card-item-body">
                    <div class="item-icon">
                      <RkIcon name="rk-icon-has-back" :size="22"/>
                    </div>
                    <div class="item-number">9999</div>
                  </div>
                </div>
              </div>
            </div>

            <div class="task-card">
              <div class="task-card-header">
                <div class="task-title">完善项目审核</div>
              </div>
              <div class="task-card-body">
                <div class="task-card-item">
                  <div class="task-card-item-head">
                    <span>未审核</span>
                  </div>
                  <div class="task-card-item-body">
                    <div class="item-icon">
                      <RkIcon name="rk-icon-no-audit" :size="22"/>
                    </div>
                    <div class="item-number">9999</div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </el-tab-pane>
      </el-tabs>
    </div>
  </div>
</template>

<script setup>
import { commonProps } from '@hp/panels/cfg.js'
import { reactive, onMounted } from 'vue';

import { RkIcon } from '@/components/rk-icon'

const emits = defineEmits([ 'mounted' ])
const props = defineProps({
  ...commonProps
})


const tabState = reactive({
  activeName: 'cbxm'
})



onMounted(() => {
  nextTick(() => { emits('mounted') })
})

</script>

<style lang="scss" scoped>

.hp-task-panel {
  height: 100%;
  display: flex;
  flex-direction: column;
  &-header {
    height: 45px;
    display: flex;
    align-items: center;
    padding: 0 8px;
    border-bottom: 1px solid #dcdfe6;
    .header-title {
      font-weight: bold;
    }
    .header-tools {
      margin-left: auto;
    }
  }
  &-body {
    flex: 1;
    min-height: 10px;
    padding: 0;
    overflow: auto;
  }
}

.hp-task-tabs {
  :deep(.el-tabs__header) {
    margin: 0;
  }
  :deep(.el-tabs__item) {
    padding: 0 !important;
  }
  :deep(.el-tabs__content) {
    padding: 18px;
    overflow: auto;
  }
}
.hp-task-tab-pane {
  &__label  {
    padding: 0 20px;
  }
  &__body {
    height: 100%;
    // display: grid;
    // gap: 12px 20px;
    // grid-template-columns: repeat(3, minmax(50px,1fr));
  }
}

.task-card {
  border-radius: 4px;
  padding: 8px 0;
  display: flex;
  flex-direction: column;

  &-header {
    display: flex;
    .task-title {
      // border: 1px solid #dcdfe6;
      font-weight: 500;
      border-bottom: none;
      padding: 6px;
      // border-radius: 4px 4px 0 0;
    }
  }
  &-body {
    flex: 1;
    min-height: 10px;
    display: grid;
    gap: 12px 12px;
    grid-template-columns: repeat(2, minmax(50px,1fr));
    // padding: 8px;
    // border: 1px solid #dcdfe6;
    // border-radius: 0 4px 4px 4px;
  }
}

.task-card-item {
  // background-image: linear-gradient(to right bottom, rgb(236, 71, 134), rgb(185, 85, 164));
  padding: 10px 16px;
  border: 1px solid #dcdfe6;
  border-radius: 8px;
  &-head {
    font-size: 16px;
    font-weight: 600;
  }
  &-body {
    display: flex;
    padding-top: 12px;
    justify-content: space-between;
    .item-icon {
      display: flex;
      align-items: center;
      vertical-align: middle;
      width: 35px;
      height: 35px;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 50%;
      color: var(--el-color-primary);
      background-color: var(--el-color-primary-light-8);
      margin-right: 15px;
    }
    .item-number {
      font-size: 30px;
      color: var(--el-color-primary);
    }
  }
}
</style>